<template>
  <div class="msg" v-show="show">
  	<span>{{message}}</span>
  </div>
</template>

<script>
  export default {
    name: 'FlowMessage',
    data() {
      return {
        message: '',
        show: false
      }
    },
    methods: {
      setMessage(msg, time) {
        this.message = msg;
        this.show = true;
        setTimeout(() => {
          this.show = false;
          this.message = '';
        }, (time || 3) * 1000);
      }
    }
  }
</script>

<style scoped>
  
div.msg {
	height: 20px;
	position: absolute;
	top: 100px;
	z-index: 2000;
	left: 0;
	right: 0;
	margin: auto;
	text-align: center;
}
div.msg > span {	
	display: inline-block;
	padding: 3px 5px;
	background-color: #E3EA8F;
	border: 1px solid #CCCCCC;
	box-shadow: #CCCCCC 1px 1px 1px;
	font-size: 14px;
}
</style>